package converter.util

class PomFinder {
	List findAllPoms(File dir) {
		List allPoms = []
		dir.eachFileRecurse { File file ->
			 if( file.isFile() && file.name == "pom.xml") {
				if(isNotMavenMetaPom(file)) {
					allPoms << file
				}
			 }
	    }
		return allPoms
	}

	private boolean isNotMavenMetaPom(File file) {
		!( file.absolutePath.contains("META-INF\\maven\\") || file.absolutePath.contains("META-INF/maven/"))
	}
}
